﻿using System.Collections.Generic;
using System.IO;

namespace Sox
{
    public class Logging
    {
        public Logging()
        {
            using(FileStream fs = File.Create(@"..\SystemLog.txt"))
            {

            }
        }

        public void EnterMethod(List<string> details, string layer)
        {
            using (StreamWriter fs = File.AppendText(@"..\SystemLog.txt"))
            {
                fs.WriteLine("Layer: " + layer);
                foreach (var detail in details)
                {
                    fs.WriteLine(detail);
                }
                fs.WriteLine("------------------------");
            }
        }

        public void LeaveMethod(List<string> details, string layer)
        {
            using (StreamWriter fs = File.AppendText(@"..\SystemLog.txt"))
            {
                fs.WriteLine("Layer: " + layer);
                foreach (var detail in details)
                {
                    fs.WriteLine(detail);
                }
                fs.WriteLine("------------------------");
            }
        }
    }
}
